﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using DAL;

namespace BLL
{
    //用来设置员工个人基本工资数据
    public class EmpItemBiz
    {
        EmpItemDao empItemDao = new EmpItemDao();
        //from Wage_EmpItem
        public bool Update(string tableName, SortedDictionary<string, string> sdList)
        {
            //更新基本信息中的银行账号


            return empItemDao.Update(tableName, sdList);
        }
        public bool Insert(string tableName, SortedDictionary<string, string> sdList)
        {
            ////如果银行账号不为空，更新员工基本资料
            //string bankName=sdList["BankName"].ToString();
            //if (!string.IsNullOrWhiteSpace(bankName))
            //{
            //    if (bankName.Length > 1)
            //    {
            //        string empCode = sdList["EmpCode"].ToString();
            //        SortedDictionary<string, string> sdList2 = new SortedDictionary<string, string>();
            //        sdList2.Add("EmpCode", empCode);
            //        sdList2.Add("SalaryState", bankName);
            //        new EmployeeDao().Update("Admin_Employee", sdList2);
            //    }
            //}
            return empItemDao.Insert(tableName, sdList);
        }


        public DataTable GetOneInfo(string empCode)
        {
            return empItemDao.GetOneInfo(empCode);
        }
        public string GetWageItemValue(string empCode, string wageItem)
        {
            return empItemDao.GetWageItemValue(empCode, wageItem);
        }
        public bool DeleteOneInfo(string empCode)
        {
            return empItemDao.DeleteOneInfo(empCode);
        }

        public bool IsExistEmpCode(string empCode)
        {
            return empItemDao.IsExistEmpCode(empCode);
        }
        public bool IsExistEmpCode(string empCode, string setsID)
        {
            return empItemDao.IsExistEmpCode(empCode, setsID);
        }
        public bool UpdateAllInfo(string itemCode, string initValue, string setsID)
        {
            return empItemDao.UpdateAllInfo(itemCode, initValue, setsID);
        }
        public DataTable GetLists(string empCode, string deptName, string setsID)
        {
            return empItemDao.GetLists(empCode, deptName, setsID);
        }
        public DataTable GetOutList(string empCode, string deptName, string setsID)
        {
            return empItemDao.GetOutList(empCode, deptName, setsID);
        }
        public DataTable GetLists()
        {
            return empItemDao.GetLists();
        }
         //无银行账号员工
        public DataTable GetNoLists()
        {
            return empItemDao.GetNoLists();
        }
        public bool AddAllEmpCode(string setsID)
        {
            return empItemDao.AddAllEmpCode(setsID);
        }

    }
}
